<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        Promise.resolve()
            .then( () => {
                console.log(1)
                throw new Error('error1') // 排出错误，状态变为rejected
        } ).catch( () => {  // rejected状态触发catch
            console.log(2)
        } ).then( () => {  // catch返回fulfilled状态，再触发then
            console.log(3)
        } )

        // 1 2 3
    </script>
</body>
</html>